package harvard.cscie160.hw7.project;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
import java.util.HashMap;

//can not get this to work

/*public class Security extends UnicastRemoteObject {

	
	 * private HashMap<Integer, SecurityInfo> access; private static Security
	 * keepSafe;
	 * 
	 * private Security() throws RemoteException { access = new HashMap<Integer,
	 * SecurityInfo>(); }
	 * 
	 * public static Security getInstance() throws RemoteException { if
	 * (keepSafe == null) keepSafe = new Security();
	 * 
	 * return keepSafe; }
	 * 
	 * public void setAccess(int accountNumber, String PIN, boolean
	 * depositPermitted, boolean withdrawPermitted, boolean balancePermitted) {
	 * SecurityInfo record = access.get(accountNumber); if (record == null) {
	 * record = new SecurityInfo(); access.put(accountNumber, record); }
	 * 
	 * record.setPIN(PIN); record.setAccess(OperationType.DEPOSIT,
	 * depositPermitted); record.setAccess(OperationType.WITHDRAWAL,
	 * withdrawPermitted); record.setAccess(OperationType.BALANCE,
	 * balancePermitted); }
	 * 
	 * private SecurityInfo getRecord(int accountNumber) throws ATMException {
	 * 
	 * SecurityInfo record = access.get(accountNumber);
	 * 
	 * if (record == null) { throw new
	 * ATMException(String.format("ERROR: unknown ID", accountNumber)); }
	 * 
	 * return record; }
	 * 
	 * 
	 * public boolean checkAccess(int accountNumber, OperationType type) throws
	 * ATMException { SecurityInfo record = getRecord(accountNumber); return
	 * record.getAccess(type); }
	 * 
	 * 
	 * public boolean checkPIN(int accountNumber, String PIN) throws
	 * ATMException { SecurityInfo record = getRecord(accountNumber);
	 * 
	 * return record.getPIN().equals(PIN); }
	 
}*/
